<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>    
<%@ page import="dao.*" %>
<%@ taglib uri="TagGroup" prefix="mytag"%>
<!DOCTYPE html>
<html> 
  <head>
    <title>Admin Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- jQuery UI -->
    <link href="https://code.jquery.com/ui/1.10.3/themes/redmond/jquery-ui.css" rel="stylesheet" media="screen">

    <!-- Bootstrap -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- styles -->
    <link href="css/styles.css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="utf8-jsp/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="utf8-jsp/ueditor.all.min.js"> </script>
	<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
	<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
	<script type="text/javascript" charset="utf-8" src="utf8-jsp/lang/zh-cn/zh-cn.js"></script>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
  	<mytag:adminPageHeaderTag/>

    <div class="page-content">
    	<div class="row">
		  <div class="col-md-2">
		  	<div class="sidebar content-box" style="display: block;">
                <ul class="nav">
                    <!-- Main menu -->
                    <li><a href="ManageAdminServlet"><i class="glyphicon glyphicon-home"></i> 管理员账号列表</a></li>
                    <li><a href="add_admin.jsp"><i class="glyphicon glyphicon-pencil"></i> 添加管理员</a></li>
                    <li><a href="ManageUserServlet"><i class="glyphicon glyphicon-home"></i> 用户账号列表</a></li>
                    <li><a href="add_user.jsp"><i class="glyphicon glyphicon-pencil"></i> 添加用户</a></li>
                    <li><a href="ManageThemeServlet"><i class="glyphicon glyphicon-home"></i> 主题列表</a></li>
                    <li class="current"><a href="Article_List_ofAdminServlet"><i class="glyphicon glyphicon-home"></i> 帖子列表</a></li>
                    <li><a href="AnnouncementServlet"><i class="glyphicon glyphicon-home"></i> 公告列表</a></li>
                    <li><a href="ReplyServlet"><i class="glyphicon glyphicon-home"></i> 用户反馈列表</a></li>
                    <li><a href="SensitiveWordServlet"><i class="glyphicon glyphicon-pencil"></i>敏感词管理</a></li>
                </ul>
             </div>
		  </div>
		  <div class="col-md-10">
			<!-- 其它界面元素在这里写↓ -->
			<div style="margin:20px auto">
				<form  role="form" action="ModifyArticleServlet?article_id=${article.article_id}&from=admin" method="POST">
					<div class="form-group" style="width:100%" >
						<input type="text" class="form-control" name="Article_title"  style="height:50px;width:65%"
								   placeholder="请输入名称" value="${article.article_title }">
					</div>
					<div>
						<script id="editor" type="text/plain" style="width:800px;height:400px;margin:0">${content}</script>	
					</div>	
					<div>
						<select class="select_score" id="selected_theme" name="selected_theme" >
						<c:forEach items="${themelist}" var="theme">
							<c:if test="${theme.theme_name==theme_name}">
								<option value="${theme.theme_id}" selected ="selected">${theme.theme_name}</option>
							</c:if>
							<c:if test="${theme.theme_name!=theme_name}">
								<option value="${theme.theme_id}">${theme.theme_name}</option>
							</c:if>
						</c:forEach>
						</select>
						<button  type="submit" class="btn btn-danger" style="margin-top:20px;margin-left:30px"> 提交发表 </button>
						<a type="button" class="btn btn-primary" href="Article_List_ofAdminServlet" style="margin-top:20px;margin-left:30px"> 取消</a>
					</div>
					
				</form>
				
			</div>
			<!-- 其它界面元素在这里写↑ -->
		  </div>
		</div>
    </div>

	<mytag:footerTag/>
      <link href="vendors/datatables/dataTables.bootstrap.css" rel="stylesheet" media="screen">

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://code.jquery.com/jquery.js"></script>
    <!-- jQuery UI -->
    <script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="bootstrap/js/bootstrap.min.js"></script>

    <script src="vendors/datatables/js/jquery.dataTables.min.js"></script>

    <script src="vendors/datatables/dataTables.bootstrap.js"></script>

    <script src="js/custom.js"></script>
    <script src="js/tables.js"></script>
    <script src="js/jquery-3.3.1.min.js"></script>
	<script src="js/jquery.validate.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/livesearch.min.js"></script>
	<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    	var ue = UE.getEditor('editor');
    	window.onload=function(){
    		var type ='<%=request.getAttribute("type")%>';
        	console.log(status);
        	if(type==2){
        		alert("修改成功！");
        	}
    	};
	</script>
	

  </body>
</html>